<?php
class communication_email_1 extends Update_Model_Database_AbstractChange{


	protected $comment="Создание таблицы communication_email";

	public function up(){
		$sql=
			'CREATE TABLE IF NOT EXISTS communication_email(
				  id INT(11) NOT NULL AUTO_INCREMENT,
				  `text` TEXT NOT NULL,
				  subject TEXT NOT NULL,
				  `from` TEXT NOT NULL,
				  `to` TEXT NOT NULL,
				  ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
				  accept TINYINT(1) NOT NULL DEFAULT 1,
				  PRIMARY KEY (id)
			)
				ENGINE = INNODB
				CHARACTER SET utf8
				COLLATE utf8_general_ci;';
		$this->db->query($sql);
	}

	public function down(){
		$sql='DROP TABLE IF EXISTS communication_email ;';
		$this->db->query($sql);
	}

}